<p>
  <h2>Title:</h2> <%=h @exam.title %>
</p>
<p>
  <h2>User:</h2> <%=h @exam.user.last_name %>
</p>
<p>
  <h2>Grades:</h2>
  <br/>
  1 - &gt;<%= @exam.percent_1 %>%<br/>
  2 - &gt;<%= @exam.percent_2 %>%<br/>
  3 - &gt;<%= @exam.percent_3 %>%<br/>
  4 - &gt;<%= @exam.percent_4 %>%<br/>
</p>
<p>
  <h2>Questions:</h2><br/>
	<table>
	<tr>
		<th>
			Text
		</th>
		<th>
			Score
		</th>
		<th>
			Type
		</th>
		<th>
			Answers
		</th>
	</tr>
	<% @exam.questions.each do |q| %>
	<tr>
		<td>
			<%= parse_images h q.text %> 
		</td>
	<td>
			<%= q.score %> 
	</td>
	<td>
			<%= 
				tmp = "Radiobutton"
				tmp = "Checkbox" if q.checkbox == 0 
				tmp
			%> 
	</td>
	<td>
		<div class="show_answers">
			<% q.answers.each do |a| %>
				<%= parse_images h a.text %> - <%= 
					tmp = "incorrect"
					tmp = "correct" if a.correctness == 1 
					tmp
				%>
				<br/>
			<% end %>
		</div>
		<% end %>
	</td>
	</tr>
	</table>
</p>

<%= link_to 'Edit', :action => 'edit', :id => @exam %> |
<%= link_to 'Back', :action => 'list' %>
